<?php
/**
 * Default configuration for Xhgui
 */
return array(
    'debug'           => false,
    'mode'            => 'development',
    /*
     * support extension: uprofiler, tideways_xhprof, tideways, xhprof
     * default: xhprof
     */
    'extension'       => 'tideways',

    // Can be either mongodb or file.
    /*
    'save.handler' => 'file',
    'save.handler.filename' => dirname(__DIR__) . '/cache/' . 'xhgui.data.' . microtime(true) . '_' . substr(md5($url), 0, 6),
    */
    'save.handler'    => 'mongodb',

    // Needed for file save handler. Beware of file locking. You can adujst this file path
    // to reduce locking problems (eg uniqid, time ...)
    //'save.handler.filename' => __DIR__.'/../data/xhgui_'.date('Ymd').'.dat',
    'db.host'         => 'mongodb://172.18.0.103:27017',
    'db.db'           => 'xhprof',

    // Allows you to pass additional options like replicaSet to MongoClient.
    // 'username', 'password' and 'db' (where the user is added)
    'db.options'      => array(
        'username' => 'root',
        'password' => '123456',
    ),
    'templates.path'  => dirname(__DIR__) . '/src/templates',
    'date.format'     => 'Y-m-d H:i:s',
    'detail.count'    => 6,
    'page.limit'      => 25,
    'cache'           => dirname(__DIR__) . '/cache/',
    // Profile 1 in 100 requests.
    // You can return true to profile every request.
    'profiler.enable' => function () {
        if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'xhgui.dev.com') {
            return false;
        }


//        if(isset($_GET['xdebug']) && $_GET['xdebug'] == 'abner')
//        {
//            return true;
//        }
//        else
//        {
//            return rand(1, 1000) === 42;
//        }
        return true;

    },

    'profiler.simple_url' => function ($url) {
        return preg_replace('/\=\d+/', '', $url);
    },

    'profiler.filter_path' => array(//'/home/admin/www/xhgui/webroot','F:/phpPro'
    )

);
